package DaEr2_2;

import java.util.Scanner;

public class ChengJi {
    public static void main(String[] args) {
        double[] scoreEnglish = new double[10];
        double[] scoreChinese = new double[10];
        Scanner scanner = new Scanner(System.in);
        double sum = 0,sum1=0;
        System.out.println("----------------------------------");
        System.out.println("请输入本次考试的十名同学英语成绩：");
        System.out.println("----------------------------------");
        for (int i = 0; i < scoreEnglish.length; i++) {
            System.out.println("请输入第" + (i + 1) + "个同学的英语成绩");
            scoreEnglish[i] = scanner.nextDouble();
        }
        System.out.println("---------------输入结束-------------------");
        System.out.println("英语平均分计算如下：");
        for (int i = 0; i < scoreEnglish.length; i++) {
            sum += scoreEnglish[i];
        }
        System.out.println("十名同学的英语平均成绩是=" + sum / scoreEnglish.length);
        System.out.println("----------------------------------");

        System.out.println("请输入本次考试的十名同学语文成绩：");
        System.out.println("----------------------------------");
        for (int i = 0; i < scoreChinese.length; i++) {
            System.out.println("请输入第" + (i + 1) + "个同学的语文成绩");
            scoreChinese[i] = scanner.nextDouble();
        }
        System.out.println("---------------输入结束-------------------");
        System.out.println("语文平均分计算如下：");

        for (int i = 0; i < scoreChinese.length; i++) {
            sum1 += scoreChinese[i];
        }
        System.out.println("十名同学的语文平均成绩是=" + sum / scoreChinese.length);
        System.out.println("----------------------------------");
        if (sum1*1.0 / scoreChinese.length > sum*1.0 / scoreEnglish.length) {
            System.out.println("恭喜语文老师，你们班成绩很不错！");
            System.out.println("英语成绩还需加强💪");
        } else if (sum1*1.0 / scoreChinese.length < sum*1.0 / scoreEnglish.length) {
            System.out.println("恭喜英语老师，你们班成绩很不错！");
            System.out.println("语文成绩还需加强💪");
        } else {
            System.out.println("大家都很棒！");
        }
    }
}

